package ru.ifmo;

import sofia_kp.SSAP_sparql_response;
import java.util.Vector;

/**
 * Created by Admin on 04.02.15.
 */
public class TestHandler implements sofia_kp.iKPIC_subscribeHandler2 {

    final boolean timeDebug = false;

    @Override
    public void kpic_RDFEventHandler(Vector<Vector<String>> newTriples, Vector<Vector<String>> oldTriples, String indSequence, String subID) {
        long startTime = System.currentTimeMillis();
        System.out.println("TestHandler EventHandler in :");
        if (newTriples.size() > 0) {
            System.out.println("New triplets:");
            for (Vector<String> it : newTriples) {
                System.out.println(new SmartSpaceTriplet(it));
            }
        }
        if (oldTriples.size() > 0) {
            System.out.println("Old triplets:");
            for (Vector<String> it : oldTriples) {
                System.out.println(new SmartSpaceTriplet(it));
            }
        }

        System.out.println("----");

        if (timeDebug) {
            System.out.println("kpic_RDFEventHandler: " + (System.currentTimeMillis() - startTime));
            System.out.println(System.currentTimeMillis());
        }
    }

    @Override
    public void kpic_SPARQLEventHandler(SSAP_sparql_response newResults, SSAP_sparql_response oldResults, String indSequence, String subID) {

    }

    @Override
    public void kpic_UnsubscribeEventHandler(String sub_ID) {

    }

    @Override
    public void kpic_ExceptionEventHandler(Throwable SocketException) {

    }
}
